/**
 * sweetalert.min.js
 */
! function(e, t, n) {
	"use strict";
	! function o(e, t, n) {
		function a(s, l) {
			if (!t[s]) {
				if (!e[s]) {
					var i = "function" == typeof require && require;
					if (!l && i) return i(s, !0);
					if (r) return r(s, !0);
					var u = new Error("Cannot find module '" + s + "'");
					throw u.code = "MODULE_NOT_FOUND", u
				}
				var c = t[s] = {
					exports: {}
				};
				e[s][0].call(c.exports, function(t) {
					var n = e[s][1][t];
					return a(n ? n : t)
				}, c, c.exports, o, e, t, n)
			}
			return t[s].exports
		}
		for (var r = "function" == typeof require && require, s = 0; s < n.length; s++) a(n[s]);
		return a
	}({
		1: [function(o, a, r) {
			var s = function(e) {
				return e && e.__esModule ? e : {
					"default": e
				}
			};
			Object.defineProperty(r, "__esModule", {
				value: !0
			});
			var l, i, u, c, d = o("./modules/handle-dom"),
				f = o("./modules/utils"),
				p = o("./modules/handle-swal-dom"),
				m = o("./modules/handle-click"),
				v = o("./modules/handle-key"),
				y = s(v),
				h = o("./modules/default-params"),
				b = s(h),
				g = o("./modules/set-params"),
				w = s(g);
			r["default"] = u = c = function() {
					function o(e) {
						var t = a;
						return t[e] === n ? b["default"][e] : t[e]
					}
					var a = arguments[0];
					if (d.addClass(t.body, "stop-scrolling"), p.resetInput(), a === n) return f.logStr(
						"SweetAlert expects at least 1 attribute!"), !1;
					var r = f.extend({}, b["default"]);
					switch (typeof a) {
						case "string":
							r.title = a, r.text = arguments[1] || "", r.type = arguments[2] || "";
							break;
						case "object":
							if (a.title === n) return f.logStr('Missing "title" argument!'), !1;
							r.title = a.title;
							for (var s in b["default"]) r[s] = o(s);
							r.confirmButtonText = r.showCancelButton ? "Confirm" : b["default"].confirmButtonText, r.confirmButtonText =
								o("confirmButtonText"), r.doneFunction = arguments[1] || null;
							break;
						default:
							return f.logStr('Unexpected type of argument! Expected "string" or "object", got ' + typeof a), !1
					}
					w["default"](r), p.fixVerticalPosition(), p.openModal(arguments[1]);
					for (var u = p.getModal(), v = u.querySelectorAll("button"), h = ["onclick", "onmouseover", "onmouseout",
							"onmousedown", "onmouseup", "onfocus"
						], g = function(e) {
							return m.handleButton(e, r, u)
						}, C = 0; C < v.length; C++)
						for (var S = 0; S < h.length; S++) {
							var x = h[S];
							v[C][x] = g
						}
					p.getOverlay().onclick = g, l = e.onkeydown;
					var k = function(e) {
						return y["default"](e, r, u)
					};
					e.onkeydown = k, e.onfocus = function() {
						setTimeout(function() {
							i !== n && (i.focus(), i = n)
						}, 0)
					}, c.enableButtons()
				}, u.setDefaults = c.setDefaults = function(e) {
					if (!e) throw new Error("userParams is required");
					if ("object" != typeof e) throw new Error("userParams has to be a object");
					f.extend(b["default"], e)
				}, u.close = c.close = function() {
					var o = p.getModal();
					d.fadeOut(p.getOverlay(), 5), d.fadeOut(o, 5), d.removeClass(o, "showSweetAlert"), d.addClass(o,
						"hideSweetAlert"), d.removeClass(o, "visible");
					var a = o.querySelector(".sa-icon.sa-success");
					d.removeClass(a, "animate"), d.removeClass(a.querySelector(".sa-tip"), "animateSuccessTip"), d.removeClass(a.querySelector(
						".sa-long"), "animateSuccessLong");
					var r = o.querySelector(".sa-icon.sa-error");
					d.removeClass(r, "animateErrorIcon"), d.removeClass(r.querySelector(".sa-x-mark"), "animateXMark");
					var s = o.querySelector(".sa-icon.sa-warning");
					return d.removeClass(s, "pulseWarning"), d.removeClass(s.querySelector(".sa-body"), "pulseWarningIns"), d.removeClass(
							s.querySelector(".sa-dot"), "pulseWarningIns"), setTimeout(function() {
							var e = o.getAttribute("data-custom-class");
							d.removeClass(o, e)
						}, 300), d.removeClass(t.body, "stop-scrolling"), e.onkeydown = l, e.previousActiveElement && e.previousActiveElement
						.focus(), i = n, clearTimeout(o.timeout), !0
				}, u.showInputError = c.showInputError = function(e) {
					var t = p.getModal(),
						n = t.querySelector(".sa-input-error");
					d.addClass(n, "show");
					var o = t.querySelector(".sa-error-container");
					d.addClass(o, "show"), o.querySelector("p").innerHTML = e, setTimeout(function() {
						u.enableButtons()
					}, 1), t.querySelector("input").focus()
				}, u.resetInputError = c.resetInputError = function(e) {
					if (e && 13 === e.keyCode) return !1;
					var t = p.getModal(),
						n = t.querySelector(".sa-input-error");
					d.removeClass(n, "show");
					var o = t.querySelector(".sa-error-container");
					d.removeClass(o, "show")
				}, u.disableButtons = c.disableButtons = function() {
					var e = p.getModal(),
						t = e.querySelector("button.confirm"),
						n = e.querySelector("button.cancel");
					t.disabled = !0, n.disabled = !0
				}, u.enableButtons = c.enableButtons = function() {
					var e = p.getModal(),
						t = e.querySelector("button.confirm"),
						n = e.querySelector("button.cancel");
					t.disabled = !1, n.disabled = !1
				}, "undefined" != typeof e ? e.sweetAlert = e.swal = u : f.logStr("SweetAlert is a frontend module!"), a.exports =
				r["default"]
		}, {
			"./modules/default-params": 2,
			"./modules/handle-click": 3,
			"./modules/handle-dom": 4,
			"./modules/handle-key": 5,
			"./modules/handle-swal-dom": 6,
			"./modules/set-params": 8,
			"./modules/utils": 9
		}],
		2: [function(e, t, n) {
			Object.defineProperty(n, "__esModule", {
				value: !0
			});
			var o = {
				title: "",
				text: "",
				type: null,
				allowOutsideClick: !1,
				showConfirmButton: !0,
				showCancelButton: !1,
				closeOnConfirm: !0,
				closeOnCancel: !0,
				confirmButtonText: "OK",
				confirmButtonColor: "#8CD4F5",
				cancelButtonText: "Cancel",
				imageUrl: null,
				imageSize: null,
				timer: null,
				customClass: "",
				html: !1,
				animation: !0,
				allowEscapeKey: !0,
				inputType: "text",
				inputPlaceholder: "",
				inputValue: "",
				showLoaderOnConfirm: !1
			};
			n["default"] = o, t.exports = n["default"]
		}, {}],
		3: [function(t, n, o) {
			Object.defineProperty(o, "__esModule", {
				value: !0
			});
			var a = t("./utils"),
				r = (t("./handle-swal-dom"), t("./handle-dom")),
				s = function(t, n, o) {
					function s(e) {
						m && n.confirmButtonColor && (p.style.backgroundColor = e)
					}
					var u, c, d, f = t || e.event,
						p = f.target || f.srcElement,
						m = -1 !== p.className.indexOf("confirm"),
						v = -1 !== p.className.indexOf("sweet-overlay"),
						y = r.hasClass(o, "visible"),
						h = n.doneFunction && "true" === o.getAttribute("data-has-done-function");
					switch (m && n.confirmButtonColor && (u = n.confirmButtonColor, c = a.colorLuminance(u, -.04), d = a.colorLuminance(
						u, -.14)), f.type) {
						case "mouseover":
							s(c);
							break;
						case "mouseout":
							s(u);
							break;
						case "mousedown":
							s(d);
							break;
						case "mouseup":
							s(c);
							break;
						case "focus":
							var b = o.querySelector("button.confirm"),
								g = o.querySelector("button.cancel");
							m ? g.style.boxShadow = "none" : b.style.boxShadow = "none";
							break;
						case "click":
							var w = o === p,
								C = r.isDescendant(o, p);
							if (!w && !C && y && !n.allowOutsideClick) break;
							m && h && y ? l(o, n) : h && y || v ? i(o, n) : r.isDescendant(o, p) && "BUTTON" === p.tagName && sweetAlert.close()
					}
				},
				l = function(e, t) {
					var n = !0;
					r.hasClass(e, "show-input") && (n = e.querySelector("input").value, n || (n = "")), t.doneFunction(n), t.closeOnConfirm &&
						sweetAlert.close(), t.showLoaderOnConfirm && sweetAlert.disableButtons()
				},
				i = function(e, t) {
					var n = String(t.doneFunction).replace(/\s/g, ""),
						o = "function(" === n.substring(0, 9) && ")" !== n.substring(9, 10);
					o && t.doneFunction(!1), t.closeOnCancel && sweetAlert.close()
				};
			o["default"] = {
				handleButton: s,
				handleConfirm: l,
				handleCancel: i
			}, n.exports = o["default"]
		}, {
			"./handle-dom": 4,
			"./handle-swal-dom": 6,
			"./utils": 9
		}],
		4: [function(n, o, a) {
			Object.defineProperty(a, "__esModule", {
				value: !0
			});
			var r = function(e, t) {
					return new RegExp(" " + t + " ").test(" " + e.className + " ")
				},
				s = function(e, t) {
					r(e, t) || (e.className += " " + t)
				},
				l = function(e, t) {
					var n = " " + e.className.replace(/[\t\r\n]/g, " ") + " ";
					if (r(e, t)) {
						for (; n.indexOf(" " + t + " ") >= 0;) n = n.replace(" " + t + " ", " ");
						e.className = n.replace(/^\s+|\s+$/g, "")
					}
				},
				i = function(e) {
					var n = t.createElement("div");
					return n.appendChild(t.createTextNode(e)), n.innerHTML
				},
				u = function(e) {
					e.style.opacity = "", e.style.display = "block"
				},
				c = function(e) {
					if (e && !e.length) return u(e);
					for (var t = 0; t < e.length; ++t) u(e[t])
				},
				d = function(e) {
					e.style.opacity = "", e.style.display = "none"
				},
				f = function(e) {
					if (e && !e.length) return d(e);
					for (var t = 0; t < e.length; ++t) d(e[t])
				},
				p = function(e, t) {
					for (var n = t.parentNode; null !== n;) {
						if (n === e) return !0;
						n = n.parentNode
					}
					return !1
				},
				m = function(e) {
					e.style.left = "-9999px", e.style.display = "block";
					var t, n = e.clientHeight;
					return t = "undefined" != typeof getComputedStyle ? parseInt(getComputedStyle(e).getPropertyValue("padding-top"),
						10) : parseInt(e.currentStyle.padding), e.style.left = "", e.style.display = "none", "-" + parseInt((n + t) /
						2) + "px"
				},
				v = function(e, t) {
					if (+e.style.opacity < 1) {
						t = t || 16, e.style.opacity = 0, e.style.display = "block";
						var n = +new Date,
							o = function(e) {
								function t() {
									return e.apply(this, arguments)
								}
								return t.toString = function() {
									return e.toString()
								}, t
							}(function() {
								e.style.opacity = +e.style.opacity + (new Date - n) / 100, n = +new Date, +e.style.opacity < 1 &&
									setTimeout(o, t)
							});
						o()
					}
					e.style.display = "block"
				},
				y = function(e, t) {
					t = t || 16, e.style.opacity = 1;
					var n = +new Date,
						o = function(e) {
							function t() {
								return e.apply(this, arguments)
							}
							return t.toString = function() {
								return e.toString()
							}, t
						}(function() {
							e.style.opacity = +e.style.opacity - (new Date - n) / 100, n = +new Date, +e.style.opacity > 0 ? setTimeout(
								o, t) : e.style.display = "none"
						});
					o()
				},
				h = function(n) {
					if ("function" == typeof MouseEvent) {
						var o = new MouseEvent("click", {
							view: e,
							bubbles: !1,
							cancelable: !0
						});
						n.dispatchEvent(o)
					} else if (t.createEvent) {
						var a = t.createEvent("MouseEvents");
						a.initEvent("click", !1, !1), n.dispatchEvent(a)
					} else t.createEventObject ? n.fireEvent("onclick") : "function" == typeof n.onclick && n.onclick()
				},
				b = function(t) {
					"function" == typeof t.stopPropagation ? (t.stopPropagation(), t.preventDefault()) : e.event && e.event.hasOwnProperty(
						"cancelBubble") && (e.event.cancelBubble = !0)
				};
			a.hasClass = r, a.addClass = s, a.removeClass = l, a.escapeHtml = i, a._show = u, a.show = c, a._hide = d, a.hide =
				f, a.isDescendant = p, a.getTopMargin = m, a.fadeIn = v, a.fadeOut = y, a.fireClick = h, a.stopEventPropagation =
				b
		}, {}],
		5: [function(t, o, a) {
			Object.defineProperty(a, "__esModule", {
				value: !0
			});
			var r = t("./handle-dom"),
				s = t("./handle-swal-dom"),
				l = function(t, o, a) {
					var l = t || e.event,
						i = l.keyCode || l.which,
						u = a.querySelector("button.confirm"),
						c = a.querySelector("button.cancel"),
						d = a.querySelectorAll("button[tabindex]");
					if (-1 !== [9, 13, 32, 27].indexOf(i)) {
						for (var f = l.target || l.srcElement, p = -1, m = 0; m < d.length; m++)
							if (f === d[m]) {
								p = m;
								break
							} 9 === i ? (f = -1 === p ? u : p === d.length - 1 ? d[0] : d[p + 1], r.stopEventPropagation(l), f.focus(), o
								.confirmButtonColor && s.setFocusStyle(f, o.confirmButtonColor)) : 13 === i ? ("INPUT" === f.tagName && (f =
								u, u.focus()), f = -1 === p ? u : n) : 27 === i && o.allowEscapeKey === !0 ? (f = c, r.fireClick(f, l)) : f =
							n
					}
				};
			a["default"] = l, o.exports = a["default"]
		}, {
			"./handle-dom": 4,
			"./handle-swal-dom": 6
		}],
		6: [function(n, o, a) {
			var r = function(e) {
				return e && e.__esModule ? e : {
					"default": e
				}
			};
			Object.defineProperty(a, "__esModule", {
				value: !0
			});
			var s = n("./utils"),
				l = n("./handle-dom"),
				i = n("./default-params"),
				u = r(i),
				c = n("./injected-html"),
				d = r(c),
				f = ".sweet-alert",
				p = ".sweet-overlay",
				m = function() {
					var e = t.createElement("div");
					for (e.innerHTML = d["default"]; e.firstChild;) t.body.appendChild(e.firstChild)
				},
				v = function(e) {
					function t() {
						return e.apply(this, arguments)
					}
					return t.toString = function() {
						return e.toString()
					}, t
				}(function() {
					var e = t.querySelector(f);
					return e || (m(), e = v()), e
				}),
				y = function() {
					var e = v();
					return e ? e.querySelector("input") : void 0
				},
				h = function() {
					return t.querySelector(p)
				},
				b = function(e, t) {
					var n = s.hexToRgb(t);
					e.style.boxShadow = "0 0 2px rgba(" + n + ", 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)"
				},
				g = function(n) {
					var o = v();
					l.fadeIn(h(), 10), l.show(o), l.addClass(o, "showSweetAlert"), l.removeClass(o, "hideSweetAlert"), e.previousActiveElement =
						t.activeElement;
					var a = o.querySelector("button.confirm");
					a.focus(), setTimeout(function() {
						l.addClass(o, "visible")
					}, 500);
					var r = o.getAttribute("data-timer");
					if ("null" !== r && "" !== r) {
						var s = n;
						o.timeout = setTimeout(function() {
							var e = (s || null) && "true" === o.getAttribute("data-has-done-function");
							e ? s(null) : sweetAlert.close()
						}, r)
					}
				},
				w = function() {
					var e = v(),
						t = y();
					l.removeClass(e, "show-input"), t.value = u["default"].inputValue, t.setAttribute("type", u["default"].inputType),
						t.setAttribute("placeholder", u["default"].inputPlaceholder), C()
				},
				C = function(e) {
					if (e && 13 === e.keyCode) return !1;
					var t = v(),
						n = t.querySelector(".sa-input-error");
					l.removeClass(n, "show");
					var o = t.querySelector(".sa-error-container");
					l.removeClass(o, "show")
				},
				S = function() {
					var e = v();
					e.style.marginTop = l.getTopMargin(v())
				};
			a.sweetAlertInitialize = m, a.getModal = v, a.getOverlay = h, a.getInput = y, a.setFocusStyle = b, a.openModal =
				g, a.resetInput = w, a.resetInputError = C, a.fixVerticalPosition = S
		}, {
			"./default-params": 2,
			"./handle-dom": 4,
			"./injected-html": 7,
			"./utils": 9
		}],
		7: [function(e, t, n) {
			Object.defineProperty(n, "__esModule", {
				value: !0
			});
			var o =
				'<div class="sweet-overlay" tabIndex="-1"></div><div class="sweet-alert"><div class="sa-icon sa-error">\n      <span class="sa-x-mark">\n        <span class="sa-line sa-left"></span>\n        <span class="sa-line sa-right"></span>\n      </span>\n    </div><div class="sa-icon sa-warning">\n      <span class="sa-body"></span>\n      <span class="sa-dot"></span>\n    </div><div class="sa-icon sa-info"></div><div class="sa-icon sa-success">\n      <span class="sa-line sa-tip"></span>\n      <span class="sa-line sa-long"></span>\n\n      <div class="sa-placeholder"></div>\n      <div class="sa-fix"></div>\n    </div><div class="sa-icon sa-custom"></div><h2>Title</h2>\n    <p>Text</p>\n    <fieldset>\n      <input type="text" tabIndex="3" />\n      <div class="sa-input-error"></div>\n    </fieldset><div class="sa-error-container">\n      <div class="icon">!</div>\n      <p>Not valid!</p>\n    </div><div class="sa-button-container">\n      <button class="cancel" tabIndex="2">Cancel</button>\n      <div class="sa-confirm-button-container">\n        <button class="confirm" tabIndex="1">OK</button><div class="la-ball-fall">\n          <div></div>\n          <div></div>\n          <div></div>\n        </div>\n      </div>\n    </div></div>';
			n["default"] = o, t.exports = n["default"]
		}, {}],
		8: [function(e, t, o) {
			Object.defineProperty(o, "__esModule", {
				value: !0
			});
			var a = e("./utils"),
				r = e("./handle-swal-dom"),
				s = e("./handle-dom"),
				l = ["error", "warning", "info", "success", "input", "prompt"],
				i = function(e) {
					var t = r.getModal(),
						o = t.querySelector("h2"),
						i = t.querySelector("p"),
						u = t.querySelector("button.cancel"),
						c = t.querySelector("button.confirm");
					if (o.innerHTML = e.html ? e.title : s.escapeHtml(e.title).split("\n").join("<br>"), i.innerHTML = e.html ? e.text :
						s.escapeHtml(e.text || "").split("\n").join("<br>"), e.text && s.show(i), e.customClass) s.addClass(t, e.customClass),
						t.setAttribute("data-custom-class", e.customClass);
					else {
						var d = t.getAttribute("data-custom-class");
						s.removeClass(t, d), t.setAttribute("data-custom-class", "")
					}
					if (s.hide(t.querySelectorAll(".sa-icon")), e.type && !a.isIE8()) {
						var f = function() {
							for (var o = !1, a = 0; a < l.length; a++)
								if (e.type === l[a]) {
									o = !0;
									break
								} if (!o) return logStr("Unknown alert type: " + e.type), {
								v: !1
							};
							var i = ["success", "error", "warning", "info"],
								u = n; - 1 !== i.indexOf(e.type) && (u = t.querySelector(".sa-icon.sa-" + e.type), s.show(u));
							var c = r.getInput();
							switch (e.type) {
								case "success":
									s.addClass(u, "animate"), s.addClass(u.querySelector(".sa-tip"), "animateSuccessTip"), s.addClass(u.querySelector(
										".sa-long"), "animateSuccessLong");
									break;
								case "error":
									s.addClass(u, "animateErrorIcon"), s.addClass(u.querySelector(".sa-x-mark"), "animateXMark");
									break;
								case "warning":
									s.addClass(u, "pulseWarning"), s.addClass(u.querySelector(".sa-body"), "pulseWarningIns"), s.addClass(u.querySelector(
										".sa-dot"), "pulseWarningIns");
									break;
								case "input":
								case "prompt":
									c.setAttribute("type", e.inputType), c.value = e.inputValue, c.setAttribute("placeholder", e.inputPlaceholder),
										s.addClass(t, "show-input"), setTimeout(function() {
											c.focus(), c.addEventListener("keyup", swal.resetInputError)
										}, 400)
							}
						}();
						if ("object" == typeof f) return f.v
					}
					if (e.imageUrl) {
						var p = t.querySelector(".sa-icon.sa-custom");
						p.style.backgroundImage = "url(" + e.imageUrl + ")", s.show(p);
						var m = 80,
							v = 80;
						if (e.imageSize) {
							var y = e.imageSize.toString().split("x"),
								h = y[0],
								b = y[1];
							h && b ? (m = h, v = b) : logStr("Parameter imageSize expects value with format WIDTHxHEIGHT, got " + e.imageSize)
						}
						p.setAttribute("style", p.getAttribute("style") + "width:" + m + "px; height:" + v + "px")
					}
					t.setAttribute("data-has-cancel-button", e.showCancelButton), e.showCancelButton ? u.style.display =
						"inline-block" : s.hide(u), t.setAttribute("data-has-confirm-button", e.showConfirmButton), e.showConfirmButton ?
						c.style.display = "inline-block" : s.hide(c), e.cancelButtonText && (u.innerHTML = s.escapeHtml(e.cancelButtonText)),
						e.confirmButtonText && (c.innerHTML = s.escapeHtml(e.confirmButtonText)), e.confirmButtonColor && (c.style.backgroundColor =
							e.confirmButtonColor, c.style.borderLeftColor = e.confirmLoadingButtonColor, c.style.borderRightColor = e.confirmLoadingButtonColor,
							r.setFocusStyle(c, e.confirmButtonColor)), t.setAttribute("data-allow-outside-click", e.allowOutsideClick);
					var g = e.doneFunction ? !0 : !1;
					t.setAttribute("data-has-done-function", g), e.animation ? "string" == typeof e.animation ? t.setAttribute(
						"data-animation", e.animation) : t.setAttribute("data-animation", "pop") : t.setAttribute("data-animation",
						"none"), t.setAttribute("data-timer", e.timer)
				};
			o["default"] = i, t.exports = o["default"]
		}, {
			"./handle-dom": 4,
			"./handle-swal-dom": 6,
			"./utils": 9
		}],
		9: [function(t, n, o) {
			Object.defineProperty(o, "__esModule", {
				value: !0
			});
			var a = function(e, t) {
					for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
					return e
				},
				r = function(e) {
					var t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
					return t ? parseInt(t[1], 16) + ", " + parseInt(t[2], 16) + ", " + parseInt(t[3], 16) : null
				},
				s = function() {
					return e.attachEvent && !e.addEventListener
				},
				l = function(t) {
					e.console && e.console.log("SweetAlert: " + t)
				},
				i = function(e, t) {
					e = String(e).replace(/[^0-9a-f]/gi, ""), e.length < 6 && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]), t = t ||
						0;
					var n, o, a = "#";
					for (o = 0; 3 > o; o++) n = parseInt(e.substr(2 * o, 2), 16), n = Math.round(Math.min(Math.max(0, n + n * t),
						255)).toString(16), a += ("00" + n).substr(n.length);
					return a
				};
			o.extend = a, o.hexToRgb = r, o.isIE8 = s, o.logStr = l, o.colorLuminance = i
		}, {}]
	}, {}, [1]), "function" == typeof define && define.amd ? define(function() {
		return sweetAlert
	}) : "undefined" != typeof module && module.exports && (module.exports = sweetAlert)
}(window, document);
/*! layer-v2.2 弹层组件 License LGPL  http://layer.layui.com/ By 贤心 */
;
! function(a, b) {
	"use strict";
	var c, d, e = {
			getPath: function() {
				var a = document.scripts,
					b = a[a.length - 1],
					c = b.src;
				if (!b.getAttribute("merge")) return c.substring(0, c.lastIndexOf("/") + 1)
			}(),
			enter: function(a) {
				13 === a.keyCode && a.preventDefault()
			},
			config: {},
			end: {},
			btn: ["&#x786E;&#x5B9A;", "&#x53D6;&#x6D88;"],
			type: ["dialog", "page", "iframe", "loading", "tips"]
		},
		f = {
			v: "2.2",
			ie6: !!a.ActiveXObject && !a.XMLHttpRequest,
			index: 0,
			path: e.getPath,
			config: function(a, b) {
				var d = 0;
				return a = a || {}, f.cache = e.config = c.extend(e.config, a), f.path = e.config.path || f.path, "string" ==
					typeof a.extend && (a.extend = [a.extend]), f.use("skin/layer.css", a.extend && a.extend.length > 0 ? function g() {
						var c = a.extend;
						f.use(c[c[d] ? d : d - 1], d < c.length ? function() {
							return ++d, g
						}() : b)
					}() : b), this
			},
			use: function(a, b, d) {
				var e = c("head")[0],
					a = a.replace(/\s/g, ""),
					g = /\.css$/.test(a),
					h = document.createElement(g ? "link" : "script"),
					i = "layui_layer_" + a.replace(/\.|\//g, "");
				return f.path ? (g && (h.rel = "stylesheet"), h[g ? "href" : "src"] = /^http:\/\//.test(a) ? a : f.path + a, h.id =
					i, c("#" + i)[0] || e.appendChild(h),
					function j() {
						(g ? 1989 === parseInt(c("#" + i).css("width")) : f[d || i]) ? function() {
							b && b();
							try {
								g || e.removeChild(h)
							} catch (a) {}
						}() : setTimeout(j, 100)
					}(), this) : void 0
			},
			ready: function(a, b) {
				var d = "function" == typeof a;
				return d && (b = a), f.config(c.extend(e.config, function() {
					return d ? {} : {
						path: a
					}
				}()), b), this
			},
			alert: function(a, b, d) {
				var e = "function" == typeof b;
				return e && (d = b), f.open(c.extend({
					content: a,
					yes: d
				}, e ? {} : b))
			},
			confirm: function(a, b, d, g) {
				var h = "function" == typeof b;
				return h && (g = d, d = b), f.open(c.extend({
					content: a,
					btn: e.btn,
					yes: d,
					cancel: g
				}, h ? {} : b))
			},
			msg: function(a, d, g) {
				var i = "function" == typeof d,
					j = e.config.skin,
					k = (j ? j + " " + j + "-msg" : "") || "layui-layer-msg",
					l = h.anim.length - 1;
				return i && (g = d), f.open(c.extend({
					content: a,
					time: 3e3,
					shade: !1,
					skin: k,
					title: !1,
					closeBtn: !1,
					btn: !1,
					end: g
				}, i && !e.config.skin ? {
					skin: k + " layui-layer-hui",
					shift: l
				} : function() {
					return d = d || {}, (-1 === d.icon || d.icon === b && !e.config.skin) && (d.skin = k + " " + (d.skin ||
						"layui-layer-hui")), d
				}()))
			},
			load: function(a, b) {
				return f.open(c.extend({
					type: 3,
					icon: a || 0,
					shade: .01
				}, b))
			},
			tips: function(a, b, d) {
				return f.open(c.extend({
					type: 4,
					content: [a, b],
					closeBtn: !1,
					time: 3e3,
					shade: !1,
					maxWidth: 210
				}, d))
			}
		},
		g = function(a) {
			var b = this;
			b.index = ++f.index, b.config = c.extend({}, b.config, e.config, a), b.creat()
		};
	g.pt = g.prototype;
	var h = ["layui-layer", ".layui-layer-title", ".layui-layer-main", ".layui-layer-dialog", "layui-layer-iframe",
		"layui-layer-content", "layui-layer-btn", "layui-layer-close"
	];
	h.anim = ["layui-anim", "layui-anim-01", "layui-anim-02", "layui-anim-03", "layui-anim-04", "layui-anim-05",
		"layui-anim-06"
	], g.pt.config = {
		type: 0,
		shade: .3,
		fix: !0,
		move: h[1],
		title: "&#x4FE1;&#x606F;",
		offset: "auto",
		area: "auto",
		closeBtn: 1,
		time: 0,
		zIndex: 19891014,
		maxWidth: 360,
		shift: 0,
		icon: -1,
		scrollbar: !0,
		tips: 2
	}, g.pt.vessel = function(a, b) {
		var c = this,
			d = c.index,
			f = c.config,
			g = f.zIndex + d,
			i = "object" == typeof f.title,
			j = f.maxmin && (1 === f.type || 2 === f.type),
			k = f.title ? '<div class="layui-layer-title" style="' + (i ? f.title[1] : "") + '">' + (i ? f.title[0] : f.title) +
			"</div>" : "";
		return f.zIndex = g, b([f.shade ? '<div class="layui-layer-shade" id="layui-layer-shade' + d + '" times="' + d +
			'" style="' + ("z-index:" + (g - 1) + "; background-color:" + (f.shade[1] || "#000") + "; opacity:" + (f.shade[0] ||
				f.shade) + "; filter:alpha(opacity=" + (100 * f.shade[0] || 100 * f.shade) + ");") + '"></div>' : "",
			'<div class="' + h[0] + " " + (h.anim[f.shift] || "") + (" layui-layer-" + e.type[f.type]) + (0 != f.type && 2 !=
				f.type || f.shade ? "" : " layui-layer-border") + " " + (f.skin || "") + '" id="' + h[0] + d + '" type="' + e.type[
				f.type] + '" times="' + d + '" showtime="' + f.time + '" conType="' + (a ? "object" : "string") +
			'" style="z-index: ' + g + "; width:" + f.area[0] + ";height:" + f.area[1] + (f.fix ? "" : ";position:absolute;") +
			'">' + (a && 2 != f.type ? "" : k) + '<div id="' + (f.id || "") + '" class="layui-layer-content' + (0 == f.type &&
				-1 !== f.icon ? " layui-layer-padding" : "") + (3 == f.type ? " layui-layer-loading" + f.icon : "") + '">' + (0 ==
				f.type && -1 !== f.icon ? '<i class="layui-layer-ico layui-layer-ico' + f.icon + '"></i>' : "") + (1 == f.type &&
				a ? "" : f.content || "") + '</div><span class="layui-layer-setwin">' + function() {
				var a = j ?
					'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>' :
					"";
				return f.closeBtn && (a += '<a class="layui-layer-ico ' + h[7] + " " + h[7] + (f.title ? f.closeBtn : 4 == f.type ?
					"1" : "2") + '" href="javascript:;"></a>'), a
			}() + "</span>" + (f.btn ? function() {
				var a = "";
				"string" == typeof f.btn && (f.btn = [f.btn]);
				for (var b = 0, c = f.btn.length; c > b; b++) a += '<a class="' + h[6] + b + '">' + f.btn[b] + "</a>";
				return '<div class="' + h[6] + '">' + a + "</div>"
			}() : "") + "</div>"
		], k), c
	}, g.pt.creat = function() {
		var a = this,
			b = a.config,
			g = a.index,
			i = b.content,
			j = "object" == typeof i;
		if (!c("#" + b.id)[0]) {
			switch ("string" == typeof b.area && (b.area = "auto" === b.area ? ["", ""] : [b.area, ""]), b.type) {
				case 0:
					b.btn = "btn" in b ? b.btn : e.btn[0], f.closeAll("dialog");
					break;
				case 2:
					var i = b.content = j ? b.content : [b.content || "http://layer.layui.com", "auto"];
					b.content = '<iframe scrolling="' + (b.content[1] || "auto") + '" allowtransparency="true" id="' + h[4] + g +
						'" name="' + h[4] + g + '" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="' + b.content[
							0] + '"></iframe>';
					break;
				case 3:
					b.title = !1, b.closeBtn = !1, -1 === b.icon && 0 === b.icon, f.closeAll("loading");
					break;
				case 4:
					j || (b.content = [b.content, "body"]), b.follow = b.content[1], b.content = b.content[0] +
						'<i class="layui-layer-TipsG"></i>', b.title = !1, b.fix = !1, b.tips = "object" == typeof b.tips ? b.tips : [b.tips,
							!0
						], b.tipsMore || f.closeAll("tips")
			}
			a.vessel(j, function(d, e) {
					c("body").append(d[0]), j ? function() {
						2 == b.type || 4 == b.type ? function() {
							c("body").append(d[1])
						}() : function() {
							i.parents("." + h[0])[0] || (i.show().addClass("layui-layer-wrap").wrap(d[1]), c("#" + h[0] + g).find("." +
								h[5]).before(e))
						}()
					}() : c("body").append(d[1]), a.layero = c("#" + h[0] + g), b.scrollbar || h.html.css("overflow", "hidden").attr(
						"layer-full", g)
				}).auto(g), 2 == b.type && f.ie6 && a.layero.find("iframe").attr("src", i[0]), c(document).off("keydown", e.enter)
				.on("keydown", e.enter), a.layero.on("keydown", function(a) {
					c(document).off("keydown", e.enter)
				}), 4 == b.type ? a.tips() : a.offset(), b.fix && d.on("resize", function() {
					a.offset(), (/^\d+%$/.test(b.area[0]) || /^\d+%$/.test(b.area[1])) && a.auto(g), 4 == b.type && a.tips()
				}), b.time <= 0 || setTimeout(function() {
					f.close(a.index)
				}, b.time), a.move().callback()
		}
	}, g.pt.auto = function(a) {
		function b(a) {
			a = g.find(a), a.height(i[1] - j - k - 2 * (0 | parseFloat(a.css("padding"))))
		}
		var e = this,
			f = e.config,
			g = c("#" + h[0] + a);
		"" === f.area[0] && f.maxWidth > 0 && (/MSIE 7/.test(navigator.userAgent) && f.btn && g.width(g.innerWidth()), g.outerWidth() >
			f.maxWidth && g.width(f.maxWidth));
		var i = [g.innerWidth(), g.innerHeight()],
			j = g.find(h[1]).outerHeight() || 0,
			k = g.find("." + h[6]).outerHeight() || 0;
		switch (f.type) {
			case 2:
				b("iframe");
				break;
			default:
				"" === f.area[1] ? f.fix && i[1] >= d.height() && (i[1] = d.height(), b("." + h[5])) : b("." + h[5])
		}
		return e
	}, g.pt.offset = function() {
		var a = this,
			b = a.config,
			c = a.layero,
			e = [c.outerWidth(), c.outerHeight()],
			f = "object" == typeof b.offset;
		a.offsetTop = (d.height() - e[1]) / 2, a.offsetLeft = (d.width() - e[0]) / 2, f ? (a.offsetTop = b.offset[0], a.offsetLeft =
			b.offset[1] || a.offsetLeft) : "auto" !== b.offset && (a.offsetTop = b.offset, "rb" === b.offset && (a.offsetTop =
			d.height() - e[1], a.offsetLeft = d.width() - e[0])), b.fix || (a.offsetTop = /%$/.test(a.offsetTop) ? d.height() *
			parseFloat(a.offsetTop) / 100 : parseFloat(a.offsetTop), a.offsetLeft = /%$/.test(a.offsetLeft) ? d.width() *
			parseFloat(a.offsetLeft) / 100 : parseFloat(a.offsetLeft), a.offsetTop += d.scrollTop(), a.offsetLeft += d.scrollLeft()
		), c.css({
			top: a.offsetTop,
			left: a.offsetLeft
		})
	}, g.pt.tips = function() {
		var a = this,
			b = a.config,
			e = a.layero,
			f = [e.outerWidth(), e.outerHeight()],
			g = c(b.follow);
		g[0] || (g = c("body"));
		var i = {
				width: g.outerWidth(),
				height: g.outerHeight(),
				top: g.offset().top,
				left: g.offset().left
			},
			j = e.find(".layui-layer-TipsG"),
			k = b.tips[0];
		b.tips[1] || j.remove(), i.autoLeft = function() {
				i.left + f[0] - d.width() > 0 ? (i.tipLeft = i.left + i.width - f[0], j.css({
					right: 12,
					left: "auto"
				})) : i.tipLeft = i.left
			}, i.where = [function() {
				i.autoLeft(), i.tipTop = i.top - f[1] - 10, j.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css(
					"border-right-color", b.tips[1])
			}, function() {
				i.tipLeft = i.left + i.width + 10, i.tipTop = i.top, j.removeClass("layui-layer-TipsL").addClass(
					"layui-layer-TipsR").css("border-bottom-color", b.tips[1])
			}, function() {
				i.autoLeft(), i.tipTop = i.top + i.height + 10, j.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css(
					"border-right-color", b.tips[1])
			}, function() {
				i.tipLeft = i.left - f[0] - 10, i.tipTop = i.top, j.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL")
					.css("border-bottom-color", b.tips[1])
			}], i.where[k - 1](), 1 === k ? i.top - (d.scrollTop() + f[1] + 16) < 0 && i.where[2]() : 2 === k ? d.width() - (i.left +
				i.width + f[0] + 16) > 0 || i.where[3]() : 3 === k ? i.top - d.scrollTop() + i.height + f[1] + 16 - d.height() > 0 &&
			i.where[0]() : 4 === k && f[0] + 16 - i.left > 0 && i.where[1](), e.find("." + h[5]).css({
				"background-color": b.tips[1],
				"padding-right": b.closeBtn ? "30px" : ""
			}), e.css({
				left: i.tipLeft,
				top: i.tipTop
			})
	}, g.pt.move = function() {
		var a = this,
			b = a.config,
			e = {
				setY: 0,
				moveLayer: function() {
					var a = e.layero,
						b = parseInt(a.css("margin-left")),
						c = parseInt(e.move.css("left"));
					0 === b || (c -= b), "fixed" !== a.css("position") && (c -= a.parent().offset().left, e.setY = 0), a.css({
						left: c,
						top: parseInt(e.move.css("top")) - e.setY
					})
				}
			},
			f = a.layero.find(b.move);
		return b.move && f.attr("move", "ok"), f.css({
			cursor: b.move ? "move" : "auto"
		}), c(b.move).on("mousedown", function(a) {
			if (a.preventDefault(), "ok" === c(this).attr("move")) {
				e.ismove = !0, e.layero = c(this).parents("." + h[0]);
				var f = e.layero.offset().left,
					g = e.layero.offset().top,
					i = e.layero.outerWidth() - 6,
					j = e.layero.outerHeight() - 6;
				c("#layui-layer-moves")[0] || c("body").append(
						'<div id="layui-layer-moves" class="layui-layer-moves" style="left:' + f + "px; top:" + g + "px; width:" + i +
						"px; height:" + j + 'px; z-index:2147483584"></div>'), e.move = c("#layui-layer-moves"), b.moveType && e.move.css({
						visibility: "hidden"
					}), e.moveX = a.pageX - e.move.position().left, e.moveY = a.pageY - e.move.position().top, "fixed" !== e.layero
					.css("position") || (e.setY = d.scrollTop())
			}
		}), c(document).mousemove(function(a) {
			if (e.ismove) {
				var c = a.pageX - e.moveX,
					f = a.pageY - e.moveY;
				if (a.preventDefault(), !b.moveOut) {
					e.setY = d.scrollTop();
					var g = d.width() - e.move.outerWidth(),
						h = e.setY;
					0 > c && (c = 0), c > g && (c = g), h > f && (f = h), f > d.height() - e.move.outerHeight() + e.setY && (f = d.height() -
						e.move.outerHeight() + e.setY)
				}
				e.move.css({
					left: c,
					top: f
				}), b.moveType && e.moveLayer(), c = f = g = h = null
			}
		}).mouseup(function() {
			try {
				e.ismove && (e.moveLayer(), e.move.remove(), b.moveEnd && b.moveEnd()), e.ismove = !1
			} catch (a) {
				e.ismove = !1
			}
		}), a
	}, g.pt.callback = function() {
		function a() {
			var a = g.cancel && g.cancel(b.index);
			a === !1 || f.close(b.index)
		}
		var b = this,
			d = b.layero,
			g = b.config;
		b.openLayer(), g.success && (2 == g.type ? d.find("iframe").on("load", function() {
			g.success(d, b.index)
		}) : g.success(d, b.index)), f.ie6 && b.IE6(d), d.find("." + h[6]).children("a").on("click", function() {
			var e = c(this).index();
			g["btn" + (e + 1)] && g["btn" + (e + 1)](b.index, d), 0 === e ? g.yes ? g.yes(b.index, d) : f.close(b.index) : 1 ===
				e ? a() : g["btn" + (e + 1)] || f.close(b.index)
		}), d.find("." + h[7]).on("click", a), g.shadeClose && c("#layui-layer-shade" + b.index).on("click", function() {
			f.close(b.index)
		}), d.find(".layui-layer-min").on("click", function() {
			f.min(b.index, g), g.min && g.min(d)
		}), d.find(".layui-layer-max").on("click", function() {
			c(this).hasClass("layui-layer-maxmin") ? (f.restore(b.index), g.restore && g.restore(d)) : (f.full(b.index, g), g
				.full && g.full(d))
		}), g.end && (e.end[b.index] = g.end)
	}, e.reselect = function() {
		c.each(c("select"), function(a, b) {
			var d = c(this);
			d.parents("." + h[0])[0] || 1 == d.attr("layer") && c("." + h[0]).length < 1 && d.removeAttr("layer").show(), d =
				null
		})
	}, g.pt.IE6 = function(a) {
		function b() {
			a.css({
				top: f + (e.config.fix ? d.scrollTop() : 0)
			})
		}
		var e = this,
			f = a.offset().top;
		b(), d.scroll(b), c("select").each(function(a, b) {
			var d = c(this);
			d.parents("." + h[0])[0] || "none" === d.css("display") || d.attr({
				layer: "1"
			}).hide(), d = null
		})
	}, g.pt.openLayer = function() {
		var a = this;
		f.zIndex = a.config.zIndex, f.setTop = function(a) {
			var b = function() {
				f.zIndex++, a.css("z-index", f.zIndex + 1)
			};
			return f.zIndex = parseInt(a[0].style.zIndex), a.on("mousedown", b), f.zIndex
		}
	}, e.record = function(a) {
		var b = [a.outerWidth(), a.outerHeight(), a.position().top, a.position().left + parseFloat(a.css("margin-left"))];
		a.find(".layui-layer-max").addClass("layui-layer-maxmin"), a.attr({
			area: b
		})
	}, e.rescollbar = function(a) {
		h.html.attr("layer-full") == a && (h.html[0].style.removeProperty ? h.html[0].style.removeProperty("overflow") : h.html[
			0].style.removeAttribute("overflow"), h.html.removeAttr("layer-full"))
	}, a.layer = f, f.getChildFrame = function(a, b) {
		return b = b || c("." + h[4]).attr("times"), c("#" + h[0] + b).find("iframe").contents().find(a)
	}, f.getFrameIndex = function(a) {
		return c("#" + a).parents("." + h[4]).attr("times")
	}, f.iframeAuto = function(a) {
		if (a) {
			var b = f.getChildFrame("html", a).outerHeight(),
				d = c("#" + h[0] + a),
				e = d.find(h[1]).outerHeight() || 0,
				g = d.find("." + h[6]).outerHeight() || 0;
			d.css({
				height: b + e + g
			}), d.find("iframe").css({
				height: b
			})
		}
	}, f.iframeSrc = function(a, b) {
		c("#" + h[0] + a).find("iframe").attr("src", b)
	}, f.style = function(a, b) {
		var d = c("#" + h[0] + a),
			f = d.attr("type"),
			g = d.find(h[1]).outerHeight() || 0,
			i = d.find("." + h[6]).outerHeight() || 0;
		(f === e.type[1] || f === e.type[2]) && (d.css(b), f === e.type[2] && d.find("iframe").css({
			height: parseFloat(b.height) - g - i
		}))
	}, f.min = function(a, b) {
		var d = c("#" + h[0] + a),
			g = d.find(h[1]).outerHeight() || 0;
		e.record(d), f.style(a, {
			width: 180,
			height: g,
			overflow: "hidden"
		}), d.find(".layui-layer-min").hide(), "page" === d.attr("type") && d.find(h[4]).hide(), e.rescollbar(a)
	}, f.restore = function(a) {
		var b = c("#" + h[0] + a),
			d = b.attr("area").split(",");
		b.attr("type");
		f.style(a, {
			width: parseFloat(d[0]),
			height: parseFloat(d[1]),
			top: parseFloat(d[2]),
			left: parseFloat(d[3]),
			overflow: "visible"
		}), b.find(".layui-layer-max").removeClass("layui-layer-maxmin"), b.find(".layui-layer-min").show(), "page" === b.attr(
			"type") && b.find(h[4]).show(), e.rescollbar(a)
	}, f.full = function(a) {
		var b, g = c("#" + h[0] + a);
		e.record(g), h.html.attr("layer-full") || h.html.css("overflow", "hidden").attr("layer-full", a), clearTimeout(b), b =
			setTimeout(function() {
				var b = "fixed" === g.css("position");
				f.style(a, {
					top: b ? 0 : d.scrollTop(),
					left: b ? 0 : d.scrollLeft(),
					width: d.width(),
					height: d.height()
				}), g.find(".layui-layer-min").hide()
			}, 100)
	}, f.title = function(a, b) {
		var d = c("#" + h[0] + (b || f.index)).find(h[1]);
		d.html(a)
	}, f.close = function(a) {
		var b = c("#" + h[0] + a),
			d = b.attr("type");
		if (b[0]) {
			if (d === e.type[1] && "object" === b.attr("conType")) {
				b.children(":not(." + h[5] + ")").remove();
				for (var g = 0; 2 > g; g++) b.find(".layui-layer-wrap").unwrap().hide()
			} else {
				if (d === e.type[2]) try {
					var i = c("#" + h[4] + a)[0];
					i.contentWindow.document.write(""), i.contentWindow.close(), b.find("." + h[5])[0].removeChild(i)
				} catch (j) {}
				b[0].innerHTML = "", b.remove()
			}
			c("#layui-layer-moves, #layui-layer-shade" + a).remove(), f.ie6 && e.reselect(), e.rescollbar(a), c(document).off(
				"keydown", e.enter), "function" == typeof e.end[a] && e.end[a](), delete e.end[a]
		}
	}, f.closeAll = function(a) {
		c.each(c("." + h[0]), function() {
			var b = c(this),
				d = a ? b.attr("type") === a : 1;
			d && f.close(b.attr("times")), d = null
		})
	}, e.run = function() {
		c = jQuery, d = c(a), h.html = c("html"), f.open = function(a) {
			var b = new g(a);
			return b.index
		}
	}, "function" == typeof define ? define(function() {
		return e.run(), f
	}) : function() {
		e.run()
	}()
}(window);
/**
 * Cookie plugin
 */
(function(factory) {
	if (typeof define === 'function' && define.amd) {
		define(['jquery'], factory)
	} else if (typeof exports === 'object') {
		module.exports = factory(require('jquery'))
	} else {
		factory(jQuery)
	}
}(function($) {
	var pluses = /\+/g;

	function encode(s) {
		return config.raw ? s : encodeURIComponent(s)
	}

	function decode(s) {
		return config.raw ? s : decodeURIComponent(s)
	}

	function stringifyCookieValue(value) {
		return encode(config.json ? JSON.stringify(value) : String(value))
	}

	function parseCookieValue(s) {
		if (s.indexOf('"') === 0) {
			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\')
		}
		try {
			s = decodeURIComponent(s.replace(pluses, ' '));
			return config.json ? JSON.parse(s) : s
		} catch (e) {}
	}

	function read(s, converter) {
		var value = config.raw ? s : parseCookieValue(s);
		return $.isFunction(converter) ? converter(value) : value
	}
	var config = $.cookie = function(key, value, options) {
		if (arguments.length > 1 && !$.isFunction(value)) {
			options = $.extend({}, config.defaults, options);
			if (typeof options.expires === 'number') {
				var days = options.expires,
					t = options.expires = new Date();
				t.setMilliseconds(t.getMilliseconds() + days * 864e+5)
			}
			return (document.cookie = [encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' +
				options.expires.toUTCString() : '', options.path ? '; path=' + options.path : '', options.domain ? '; domain=' +
				options.domain : '', options.secure ? '; secure' : ''
			].join(''))
		}
		var result = key ? undefined : {},
			cookies = document.cookie ? document.cookie.split('; ') : [],
			i = 0,
			l = cookies.length;
		for (; i < l; i++) {
			var parts = cookies[i].split('='),
				name = decode(parts.shift()),
				cookie = parts.join('=');
			if (key === name) {
				result = read(cookie, value);
				break
			}
			if (!key && (cookie = read(cookie)) !== undefined) {
				result[name] = cookie
			}
		}
		return result
	};
	config.defaults = {};
	$.removeCookie = function(key, options) {
		$.cookie(key, '', $.extend({}, options, {
			expires: -1
		}));
		return !$.cookie(key)
	}
}));
/**
 * Pin plugin
 */
(function(e) {
	"use strict";
	e.fn.pin = function(t) {
		var n = 0,
			r = [],
			i = false,
			s = e(window);
		t = t || {};
		var o = function() {
			for (var n = 0, o = r.length; n < o; n++) {
				var u = r[n];
				if (t.minWidth && s.width() <= t.minWidth) {
					if (u.parent().is(".pin-wrapper")) {
						u.unwrap()
					}
					u.css({
						width: "",
						left: "",
						top: "",
						position: ""
					});
					if (t.activeClass) {
						u.removeClass(t.activeClass)
					}
					i = true;
					continue
				} else {
					i = false
				}
				var a = t.containerSelector ? u.closest(t.containerSelector) : e(document.body);
				var f = u.offset();
				var l = a.offset();
				var c = u.offsetParent().offset();
				if (!u.parent().is(".pin-wrapper")) {
					u.wrap("<div class='pin-wrapper'>")
				}
				var h = e.extend({
					top: 0,
					bottom: 0
				}, t.padding || {});
				u.data("pin", {
					pad: h,
					from: (t.containerSelector ? l.top : f.top) - h.top,
					to: l.top + a.height() - u.outerHeight() - h.bottom,
					end: l.top + a.height(),
					parentTop: c.top
				});
				u.css({
					width: u.outerWidth()
				});
				u.parent().css("height", u.outerHeight())
			}
		};
		var u = function() {
			if (i) {
				return
			}
			n = s.scrollTop();
			var o = [];
			for (var u = 0, a = r.length; u < a; u++) {
				var f = e(r[u]),
					l = f.data("pin");
				if (!l) {
					continue
				}
				o.push(f);
				var c = l.from - l.pad.bottom,
					h = l.to - l.pad.top;
				if (c + f.outerHeight() > l.end) {
					f.css("position", "");
					continue
				}
				if (c < n && h > n) {
					!(f.css("position") == "fixed") && f.css({
						left: f.offset().left,
						top: l.pad.top
					}).css("position", "fixed");
					if (t.activeClass) {
						f.addClass(t.activeClass)
					}
				} else if (n >= h) {
					f.css({
						left: "",
						top: h - l.parentTop + l.pad.top
					}).css("position", "absolute");
					if (t.activeClass) {
						f.addClass(t.activeClass)
					}
				} else {
					f.css({
						position: "",
						top: "",
						left: ""
					});
					if (t.activeClass) {
						f.removeClass(t.activeClass)
					}
				}
			}
			r = o
		};
		var a = function() {
			o();
			u()
		};
		this.each(function() {
			var t = e(this),
				n = e(this).data("pin") || {};
			if (n && n.update) {
				return
			}
			r.push(t);
			e("img", this).one("load", o);
			n.update = a;
			e(this).data("pin", n)
		});
		s.scroll(u);
		s.resize(function() {
			o()
		});
		o();
		s.load(a);
		return this
	}
})(jQuery);
(function(window, $) {
	/**
	 * Ajax setting
	 */
	$.ajaxSetup({
		timeout: 30000,
		contentType: 'application/json',
		dataType: 'json',
		headers: {
			'Accept': 'application/json',
			'Content-Type': 'application/json'
		},
		error: function(xhr, status, e) {
			alert('加载失败!');
		},
		beforeSend: function(xhr) {},
		complete: function(xhr) {

		}
	});
	window.mwconst = {
		error: {
			loadingErr: '加载错误, 请稍候再试',
			dataErr: ' 数据错误'
		},
		noMore: '没有更多了',
		phoneValidCodeSendSuccess: '手机验证码已发送，请注意查收'
	};
	window.app = {
		hideLoading: function() {
			setTimeout(function() {}, 0);
		},
		get: function(api, data, successCallback) {
			$.ajax({
				type: 'GET',
				url: api,
				data: data,
				success: function(resJson) {
					if (typeof(successCallback) == 'function' && resJson) {
						successCallback(resJson);
					}
				},
				error: function(xhr) {},
				complete: function(xhr) {}
			});

		},
		post: function(api, data, successCallback) {
			$.ajax({
				type: 'POST',
				url: api,
				data: JSON.stringify(data),
				success: function(resJson) {
					if (typeof(successCallback) == 'function' && resJson) {
						successCallback(resJson);
					}
				},
				error: function(xhr) {

				},
				complete: function(xhr) {}
			});
		},
		createUploadIframe: function(id, uri) {
			//create frame
			var frameId = 'jUploadFrame' + id;
			var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId +
				'" style="position:absolute; top:-9999px; left:-9999px"';
			if (window.ActiveXObject) {
				if (typeof uri == 'boolean') {
					iframeHtml += ' src="' + 'javascript:false' + '"';
				} else if (typeof uri == 'string') {
					iframeHtml += ' src="' + uri + '"';
				}
			}
			iframeHtml += ' />';
			jQuery(iframeHtml).appendTo(document.body);
			return jQuery('#' + frameId).get(0);
		},
		createUploadForm: function(id, fileElementId, data, fileElement) {
			//create form
			var formId = 'jUploadForm' + id;
			var fileId = 'jUploadFile' + id;
			var form = jQuery('<form  action="" method="POST" name="' + formId + '" id="' + formId +
				'" enctype="multipart/form-data"></form>');
			if (data) {
				for (var i in data) {
					jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
				}
			}
			var oldElement;
			if (fileElement == null)
				oldElement = jQuery('#' + fileElementId);
			else
				oldElement = fileElement;

			var newElement = jQuery(oldElement).clone();
			jQuery(oldElement).attr('id', fileId);
			jQuery(oldElement).before(newElement);
			jQuery(oldElement).appendTo(form);
			//set attributes
			jQuery(form).css('position', 'absolute');
			jQuery(form).css('top', '-1200px');
			jQuery(form).css('left', '-1200px');
			jQuery(form).appendTo('body');
			return form;
		},
		handleError: function(s, xml, status, e) {
			// If a local callback was specified, fire it
			if (s.error)
				s.error(xml, status, e);
			// Fire the global callback
			if (s.global)
				jQuery.event.trigger("ajaxError", [xml, s, e]);
		},
		uploadHttpData: function(r, type) {
			var data = !type;
			data = type == "xml" || data ? r.responseXML : r.responseText;
			// If the type is "script", eval it in global context
			if (type == "script")
				jQuery.globalEval(data);
			// Get the JavaScript object, if JSON is used.
			if (type == "json")
				eval("data = " + data);
			// evaluate scripts within html
			if (type == "html")
				jQuery("<div>").html(data).evalScripts();
			return data;
		},
		ajaxFileUpload: function(s) {
			s = jQuery.extend({}, jQuery.ajaxSettings, s);
			var id = new Date().getTime();
			var form = app.createUploadForm(id, s.fileElementId, (typeof(s.data) == 'undefined' ? false : s.data), s.fileElement);
			var io = app.createUploadIframe(id, s.secureuri);
			var frameId = 'jUploadFrame' + id;
			var formId = 'jUploadForm' + id;
			// Watch for a new set of requests
			if (s.global && !jQuery.active++) {
				jQuery.event.trigger("ajaxStart");
			}
			var requestDone = false;
			// Create the request object
			var xml = {};
			if (s.global)
				jQuery.event.trigger("ajaxSend", [xml, s]);
			// Wait for a response to come back
			var uploadCallback = function(isTimeout) {
				var io = document.getElementById(frameId);
				try {
					if (io.contentWindow) {
						xml.responseText = io.contentWindow.document.body ? io.contentWindow.document.body.innerHTML : null;
						xml.responseXML = io.contentWindow.document.XMLDocument ? io.contentWindow.document.XMLDocument : io.contentWindow
							.document;

					} else if (io.contentDocument) {
						xml.responseText = io.contentDocument.document.body ? io.contentDocument.document.body.innerHTML : null;
						xml.responseXML = io.contentDocument.document.XMLDocument ? io.contentDocument.document.XMLDocument : io.contentDocument
							.document;
					}
				} catch (e) {
					jQuery.handleError(s, xml, null, e);
				}
				if (xml || isTimeout == "timeout") {
					requestDone = true;
					var status;
					try {
						status = isTimeout != "timeout" ? "success" : "error";
						// Make sure that the request was successful or notmodified
						if (status != "error") {
							// process the data (runs the xml through httpData regardless of callback)
							var data = app.uploadHttpData(xml, s.dataType);
							// If a local callback was specified, fire it and pass it the data
							if (s.success)
								s.success(data, status);
							// Fire the global callback
							if (s.global)
								jQuery.event.trigger("ajaxSuccess", [xml, s]);
						} else
							app.handleError(s, xml, status);
					} catch (e) {
						status = "error";
						app.handleError(s, xml, status, e);
					}
					// The request was completed
					if (s.global)
						jQuery.event.trigger("ajaxComplete", [xml, s]);
					// Handle the global AJAX counter
					if (s.global && !--jQuery.active)
						jQuery.event.trigger("ajaxStop");
					// Process result
					if (s.complete)
						s.complete(xml, status);
					jQuery(io).unbind();
					setTimeout(function() {
						try {
							jQuery(io).remove();
							jQuery(form).remove();
						} catch (e) {
							app.handleError(s, xml, null, e);
						}
					}, 100);
				}
			};
			// Timeout checker
			if (s.timeout > 0) {
				setTimeout(function() {
					// Check to see if the request is still happening
					if (!requestDone) uploadCallback("timeout");
				}, s.timeout);
			}
			try {
				form = jQuery('#' + formId);
				jQuery(form).attr('action', s.url);
				jQuery(form).attr('method', 'POST');
				jQuery(form).attr('target', frameId);
				if (form.encoding) {
					jQuery(form).attr('encoding', 'multipart/form-data');
				} else {
					jQuery(form).attr('enctype', 'multipart/form-data');
				}
				jQuery(form).submit();
			} catch (e) {
				app.handleError(s, xml, null, e);
			}
			jQuery('#' + frameId).load(uploadCallback);
			return {
				abort: function() {
					try {
						jQuery('#' + frameId).remove();
						jQuery(form).remove();
					} catch (e) {}
				}
			};
		},
		warning: function(content, callBack) {
			if (callBack && typeof(callBack) == "function") {
				swal({
					title: "警告",
					text: content,
					type: "warning"
				}, callBack);
			} else {
				swal({
					title: "警告",
					text: content,
					type: "warning"
				});
			}
		},
		success: function(content, callBack) {
			if (callBack && typeof(callBack) == "function") {
				swal({
					title: "成功",
					text: content,
					type: "success"
				}, callBack);
			} else {
				swal({
					title: "成功",
					text: content,
					type: "success"
				});
			}
		},
		info: function(content, callBack) {
			if (callBack && typeof(callBack) == "function") {
				swal({
					title: "信息",
					text: content,
					type: "info"
				}, callBack);
			} else {
				swal({
					title: "信息",
					text: content,
					type: "info"
				});
			}
		},
		error: function(content, callBack) {
			if (callBack && typeof(callBack) == "function") {
				swal({
					title: "错误",
					text: content,
					type: "error"
				}, callBack);
			} else {
				swal({
					title: "错误",
					text: content,
					type: "error"
				});
			}
		},
		successMsg: function(content, callBcak) {
			layer.msg(content, {
				icon: 1,
				offset: 'rb',
				time: 3000 //2秒关闭（如果不配置，默认是3秒）
			}, function() {
				if (typeof callBcak == 'function') {
					callBcak();
				}
			});
		},
		util: {
			isEmpty: function(input) {
				if (input == undefined || $.trim(input) === '') {
					return true;
				}
				return false;
			},
			regex: {
				isZip: function(input) {
					var re = /^[1-9][0-9]{5}$/;
					return re.test(input);
				},
				isMobile: function(input) {
					var mobileReg = /^1\d{10}$/;
					return mobileReg.test(input);
				},
				isEmail: function(email) {
					var re =
						/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
					return re.test(email);
				}
			},
			backToTop: function() {
				var left = 0;
				var body = $('body');
				$backTop = $('.back-top');
				if (body.width() <= 1280) { //iPad等尺寸更小的设备
					$backTop.addClass('fix-back-top');
					$backTop.css({
						'right': '20px'
					});
				} else { // PC
					var warp = $("body>.warp");
					left = warp.offset().left + warp.width() + 8;
					$backTop.css({
						'left': left + 'px'
					});
				}
				$backTop.css('bottom', '150px');
				$backTop.on("click", ".concat", function() {
					_MEIQIA('showPanel');
				});
				$(window).scroll(function() {
					var t = $(document).scrollTop();
					if (t > 150) {
						$backTop.find('.back').fadeIn();
					} else {
						$backTop.find('.back').fadeOut();
						$backTop.on("click", ".back", function() {
							$(document).scrollTop(0);
						});
					}
				});
			},
			isLogined: function() {
				return !app.util.isEmpty($.cookie("miaomiao"));
			},
			formatDateToZH: function(millisecond) {
				var date = new Date(millisecond * 1000);
				var month = date.getMonth() + 1;
				month = app.util.fillLeftOneZeroWhenLess(month, 10);
				var thatDate = date.getDate();
				thatDate = app.util.fillLeftOneZeroWhenLess(thatDate, 10);
				return date.getFullYear() + '年' + month + '月' + thatDate + '日';
			},
			formatDate: function(millisecond) {
				var date = new Date(millisecond * 1000);
				var month = date.getMonth() + 1;
				month = app.util.fillLeftOneZeroWhenLess(month, 10);
				var thatDate = date.getDate();
				thatDate = app.util.fillLeftOneZeroWhenLess(thatDate, 10);
				var hour = date.getHours();
				hour = app.util.fillLeftOneZeroWhenLess(hour, 10);
				var mins = date.getMinutes();
				mins = app.util.fillLeftOneZeroWhenLess(mins, 10);
				return date.getFullYear() + '/' + month + '/' + thatDate + ' ' + hour + ':' + mins;
			},
			fillLeftOneZeroWhenLess: function(input, num) {
				if (parseInt(input) < num) {
					return '0' + input;
				} else {
					return input;
				}
			},
			loadCSS: function(url) {
				$('head').prepend('<link rel="stylesheet" href="' + url + '"/>');
			},
			checkBrowser: function() {
				if (/MicroMessenger/i.test(navigator.userAgent)) {
					return 'wechat';
				} else if (/android/i.test(navigator.userAgent)) {
					return 'android';
				} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
					return 'iOS';
				} else if (/Linux/i.test(navigator.userAgent)) {
					return 'linux broswer';
				} else if (/Linux/i.test(navigator.platform)) {
					return 'linux platform';
				} else if (/BlackBerry/i.test(navigator.userAgent)) {
					return 'BlackBerry';
				} else {
					return 'pc';
				}
			},
			isLowIE: function() {
				var isLowIE = false;
				if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i) == "7.") {
					isLowIE = true;
				} else if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i) == "8.") {
					isLowIE = true;
				} else if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/9./i) == "9.") {
					isLowIE = true;
				} else if (navigator.appName == "Microsoft Internet Explorer") {
					isLowIE = true;
				}
				return isLowIE;
			},
			setCookie: function(cname, cvalue, exdays) {
				var date = new Date();
				date.setTime(date.getTime() + (exdays * 24 * 60 * 60 * 1000));
				var expires = "expires=" + date.toUTCString();
				document.cookie = cname + "=" + cvalue + "; " + expires + ";path=/";
			},
			getQuery: function() {
				var url = location.search;
				var theRequest = {};
				if (url.indexOf("?") != -1) {
					var str = url.substr(1);
					var strs = str.split("&");
					for (var i = 0; i < strs.length; i++) {
						theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
					}
				}
				return theRequest;
			},
			StringStartWith: function(origin, contained) {
				if (origin == null || origin == "" || origin.length == 0 || contained.length > origin.length) {
					return false;
				}
				return origin.substr(0, contained.length) == contained;
			},
			ellipsisStr: function(original, length) {
				if (original && original.length > length) {
					return original.substring(0, length) + '...';
				}
				return '';
			},
			clearCookie: function() {
				var cookies = document.cookie.split(";");
				for (var i = 0; i < cookies.length; i++) {
					var spcook = cookies[i].split("=");
					deleteCookie(spcook[0]);
				}

				function deleteCookie(cookiename) {
					var d = new Date();
					d.setDate(d.getDate() - 1);
					var expires = ";expires=" + d;
					var name = cookiename;
					//alert(name);
					var value = "";
					document.cookie = name + "=" + value + expires + "; path=/acc/html";
				}
			},
			deepCopy: function(obj) {
				var attr, newObj = {};
				if (typeof obj != 'object') return obj;
				for (attr in obj) {
					newObj[attr] = app.util.deepCopy(obj[attr]);
				}
				return newObj;
			},
			previewLocalImage: function previewImage(file, $imgSelector) {
				if (file.files && file.files[0]) {
					var reader = new FileReader();
					reader.onload = function(evt) {
						$($imgSelector).attr('src', evt.target.result);
					};
					reader.readAsDataURL(file.files[0]);
				} else { //兼容IE

				}
			},
			weChatLogin: function(options) {
				var opt = $.extend({
					redirectUri: "",
					wxAppId: "",
					boxId: ""
				}, options);
				$.ajax({
					url: "//res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js",
					dataType: "script",
					cache: true
				}).done(function() {
					var $box = $("#" + opt.boxId);
					$box.css({
						"position": "absolute",
						"top": 0,
						"left": 0,
						"bottom": 0,
						"background": "white",
						"width": "100%",
						"padding-top": "24px",
						"text-align": "center"
					});
					new WxLogin({
						id: opt.boxId,
						appid: opt.wxAppId,
						redirect_uri: opt.redirectUri + "/wechat?goto=" + encodeURIComponent(window.location.href),
						scope: "snsapi_login",
						style: "black",
						state: "mwh"
					});
					$box.show().on("click", function() {
						$(this).hide();
					});
				});
			},
			initSocialLogin: function(options) {
				$(".social", "#loginContent").on("click", ".wechat", function(e) {
					e.preventDefault();
					app.util.weChatLogin(options);
				});
			},
			init: function(options) {
				this.backToTop();
				this.initSocialLogin(options);
				return this;
			}
		}
	};
	/**
	 * jQuery Extend
	 */
	$.extend({
		regLoginFrame: function(flag, gotoPage) {
			if (typeof flag != 'string') {
				throw new Error('the argument must be string');
			}
			var opt = ['login', 'reg'];
			var contains = false;
			for (var i = 0; i < opt.length; i++) {
				if (flag == opt[i]) {
					contains = true;
					break;
				}
			}
			if (!contains) {
				throw new Error('error flag');
			}
			var getValidCodeTip = '点击获取短信验证码';
			var regLoginLayer = layer.open({
				type: 1,
				area: ['400px', '550px'],
				scrollbar: false,
				title: '<h2 class="layer-title"><span>妙汇会员</span></h2>',
				content: $('#regLogin')
			});

			$('#loginValidCodeImg').on('click', function() {
				$(this).attr('src', '/code?_' + new Date().getTime());
			});
			$('#mobileLoginValidCodeImg').on('click', function() {
				$(this).attr('src', '/code?_' + new Date().getTime());
			});
			$('#mobileRegValidCodeImg').on('click', function() {
				$(this).attr('src', '/code?_' + new Date().getTime());
			});

			$('#switchToMobileLoginBtn').on('click', function() {
				$('.normal-login').hide();
				$('.mobile-login').show();
				$('#mobileLoginValidCodeImg').click();
			});

			$('#switchToNormalLoginBtn').on('click', function() {
				$('.mobile-login').hide();
				$('.normal-login').show();
				$('#loginValidCodeImg').click();
			});

			function initPicValidCode(flag) {
				if ('reg' == flag) {
					$('#mobileRegValidCodeImg').click();
				} else if ('login' == flag) {
					if ($('#loginContent').find('.mobile-login').is(':visible')) {
						$('#mobileLoginValidCodeImg').click();
					}
					if ($('#loginContent').find('.normal-login').is(':visible')) {
						$('#loginValidCodeImg').click();
					}
				}
			}
			initPicValidCode(flag);
			$('.tab>li', '#regLogin').on('click', function() {
				$(this).removeClass('tab-item').addClass('tab-item-active').siblings().removeClass('tab-item-active').addClass(
					'tab-item');
				var ref = $(this).attr('data-ref');
				$('#' + ref + 'Content', '#regLogin .content').show().siblings().hide();
				initPicValidCode(ref);
			});
			$('.tab>li[data-ref="' + flag + '"]', '#regLogin').click();

			function loginClickValidCode() {
				var self = $(this);
				var mobile = $('#mobileLoginNumber').val();
				if (app.util.isEmpty(mobile) || !app.util.regex.isMobile(mobile)) {
					app.warning("请填写正确的手机号码");
					return false;
				}
				var validCode = $.trim($('#mobileLoginValidCodeVal').val());
				if (app.util.isEmpty(validCode) || validCode.length < 4) {
					app.warning("请填写正确的图形验证码");
					return false;
				}
				self.off('click');
				var timeLeft = 60;
				self.text('重新获取(' + (--timeLeft) + ')');
				app.info(mwconst.phoneValidCodeSendSuccess);
				app.post('/phoneToken/' + mobile, {
					validCode: validCode
				}, function(res) {
					if (res.resultCode == 1) {
						var timer = setInterval(function() {
							self.text('重新获取(' + (--timeLeft) + ')');
							if (timeLeft <= 0) {
								clearInterval(timer);
								self.text(getValidCodeTip).on('click', loginClickValidCode);
							}
						}, 1000);
					} else {
						$('#mobileLoginValidCodeImg').click();
						app.error(res.resultMsg);
					}
				});
			}
			$('#mobileLoginGetValidCode').on('click', loginClickValidCode);
			// mobile login
			$('#mobileLoginBtn').on('click', function() {
				var mobile = $('#mobileLoginNumber').val();
				if (app.util.isEmpty(mobile) || !app.util.regex.isMobile(mobile)) {
					app.warning("请填写正确的手机号码");
					return false;
				}
				var validCode = $.trim($('#mobileLoginValidCodeVal').val());
				if (app.util.isEmpty(validCode) || validCode.length < 4) {
					app.warning("请填写正确的图形验证码");
					return false;
				}
				var mobileLoginValidCode = $.trim($('#mobileLoginValidCode').val());
				if (app.util.isEmpty(mobileLoginValidCode) || mobileLoginValidCode.length < 4) {
					app.warning("请填写正确手机验证码");
					return false;
				}
				app.post('/mobileUserLogin', {
					mobile: mobile,
					password: mobileLoginValidCode,
					recommendCode: ''
				}, function(res) {
					if (res.resultCode != 1) {
						app.error(res.resultMsg);
						$('#mobileLoginValidCodeImg').click();
					} else {
						if (!app.util.isEmpty(gotoPage)) {
							window.location = gotoPage;
						} else {
							window.location.reload();
						}
					}
				});
			});
			// normal login
			$('#loginBtn').on('click', function() {
				var validCode = $('#loginValidCodeVal').val();
				if (app.util.isEmpty(validCode)) {
					app.info("请输入验证码");
					return false;
				}
				var userName = $('#loginUserName').val();
				var userPassword = $('#loginUserPassword').val();
				if (app.util.isEmpty(userName) || app.util.isEmpty(userPassword)) {
					app.info('请将用户名和密码填写完整');
					return false;
				}
				app.post('/login', {
					user_name: userName,
					password: userPassword,
					validCode: validCode
				}, function(res) {
					if (res.resultCode != 1) {
						app.error(res.resultMsg);
						$('#loginValidCodeImg').click();
					} else {
						if (!app.util.isEmpty(gotoPage)) {
							window.location = gotoPage;
						} else {
							window.location.reload();
						}
					}
				});
			});

			function regClickValidCode() {
				var self = $(this);
				var mobile = $.trim($('#regUserMobile').val());
				if (app.util.isEmpty(mobile) || !app.util.regex.isMobile(mobile)) {
					app.warning("请填写正确的手机号码");
					return false;
				}
				var mobileRegValidCodeVal = $.trim($('#mobileRegValidCodeVal').val());
				if (app.util.isEmpty(mobileRegValidCodeVal)) {
					app.warning('请填写正确的图形验证码');
					return false;
				}
				self.off('click');
				var timeLeft = 60;
				self.text('重新获取(' + (--timeLeft) + ')');
				app.info(mwconst.phoneValidCodeSendSuccess);
				app.post('/phoneToken/' + mobile, {
					validCode: mobileRegValidCodeVal
				}, function(res) {
					if (res.resultCode == 1) {
						var timer = setInterval(function() {
							self.text('重新获取(' + (--timeLeft) + ')');
							if (timeLeft <= 0) {
								clearInterval(timer);
								self.text(getValidCodeTip).on('click', regClickValidCode);
							}
						}, 1000);
					} else {
						app.error(res.resultMsg);
						$('#mobileRegValidCodeImg').click();
					}
				});
			}
			$('#getValidCode').on('click', regClickValidCode);
			$('#regBtn').on('click', function() {
				var mobile = $.trim($('#regUserMobile').val());
				if (app.util.isEmpty(mobile) || !app.util.regex.isMobile(mobile)) {
					app.warning("请填写正确的手机号码");
					return false;
				}
				var validCode = $.trim($('#mobileRegValidCodeVal').val());
				if (app.util.isEmpty(validCode)) {
					app.warning('请填写正确的图形验证码');
					return false;
				}
				var regValidCode = $.trim($('#regValidCode').val());
				if (app.util.isEmpty(validCode)) {
					app.warning('请填写短信验证码');
					return false;
				}
				var isCheckedRules = $('#regRule').is(':checked');
				if (!isCheckedRules) {
					app.warning("请先查看及同意《妙汇用户注册协议》");
					return false;
				}

				app.post('/mobileUserLogin', {
					mobile: mobile,
					password: regValidCode,
					recommendCode: ''
				}, function(res) {
					if (res.resultCode != 1) {
						app.error(res.resultMsg);
						$('#mobileRegValidCodeImg').click();
					} else {
						if (!app.util.isEmpty(gotoPage)) {
							window.location = gotoPage;
						} else {
							window.location.reload();
						}
					}
				});
			});
		},
		datePicker: function(yearSelectorId, monthSelectorId, dateSelectorId, defaultVal) {
			var yearRange = 50; //后推50年
			var monthHead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // 平年
			var now = new Date();
			var curYear = now.getFullYear();
			var startYear = curYear - yearRange;
			if (defaultVal && $.trim(defaultVal) != '') {
				var defaultVals = defaultVal.split('-');
				var defaultYear = defaultVals[0] || curYear;
				var defaultMonth = defaultVals[1] || 1;
				var defaultDate = defaultVals[2] || 1;
			}
			$('#' + yearSelectorId).append('<option>-年-</option>');
			$('#' + monthSelectorId).append('<option>-月-</option>');
			$('#' + dateSelectorId).append('<option>-日-</option>');
			for (var i = curYear; i >= startYear; i--) {
				if (defaultYear && i == defaultYear) {
					$('#' + yearSelectorId).append('<option value="' + i + '" selected>' + i + '</option>');
				} else {
					$('#' + yearSelectorId).append('<option value="' + i + '">' + i + '</option>');
				}
			}
			$('#' + yearSelectorId).on('change', function() {
				var selectedYear = $(this).val();
				if (selectedYear > 0) {
					var isLeapYear = 0 == selectedYear % 4 && (selectedYear % 100 != 0 || selectedYear % 400 == 0);
					$('#' + monthSelectorId).empty().append('<option>-月-</option>');
					for (var j = 1; j < 13; j++) {
						if (defaultMonth && j == defaultMonth) {
							$('#' + monthSelectorId).append('<option value="' + j + '" selected>' + j + '</option>');
						} else {
							$('#' + monthSelectorId).append('<option value="' + j + '">' + j + '</option>');
						}
					}
					$('#' + monthSelectorId).on('change', function() {
						var selectedMonth = $(this).val();
						var monthDays = monthHead[selectedMonth - 1];
						if (selectedMonth == 2 && isLeapYear) {
							monthDays += 1;
						}
						$('#' + dateSelectorId).empty().append('<option>-日-</option>');
						for (var k = 1; k <= monthDays; k++) {
							if (defaultDate && k == defaultDate) {
								$('#' + dateSelectorId).append('<option value="' + k + '" selected>' + k + '</option>');
							} else {
								$('#' + dateSelectorId).append('<option value="' + k + '">' + k + '</option>');
							}
						}
					});
				}
			});
			$('#' + yearSelectorId).change();
			$('#' + monthSelectorId).change();
		},
		checkLogin: function(succCallBack) {
			var u = $.cookie("miaomiao");
			if (!u) {
				$.regLoginFrame("login");
				return false;
			} else {
				if (typeof succCallBack == 'function') {
					succCallBack();
				}
			}
			return u;
		}
	});
})(window, jQuery);
